|
In the last lesson we covered
In this lesson we'll look at
What is a restriction?Put simply, a restriction filter allows only a limited section of text to be processed. It does this using sub filters, which are shown below it and indented to the right in the filter view. A restriction filter to delete 11 lines starting at line 3 might look like this: A restriction might be lines 100 to 199, columns 30 to 36, lines containing the text 'ERROR', a range of CSV or Tab-delimited fields or a combination of these subsets, such as columns 3 to 17 of lines 20 to 55. Restrictions and sub filters are very handy when you only want to apply a filter to a subset of the text, such as only performing a search and replace within the first 10 lines. Many other variations are possible. Click here to find out how to add a sub filter Display of sub filtersTextPipe displays sub filters with a filter hierarchy or filter tree, very similar to the way that Windows Explorer shows drives A: and C: as subsets of My Computer. When you see a hierarchy of filters in TextPipe you know that a subset of the text is being treated specially. You can imagine the very top part of TextPipe's filter display to be selecting a very large subset - the entire file. Creating a sub filterTo create a sub filter, you first need to Select the subset of text that you want to treat specially. You do this by choosing one of the filters in the Restrict Menu. Let's do this now. We will create a filter that will replace the word 'TextPipe' with 'TextPipe Pro' but only in lines 1 to 3:
After the Trial run completes, you'll notice that only the second and third occurrences of 'TextPipe' have been replaced with 'TextPipe Pro'. This is exactly what we wanted - the Line Range sub filter has only passed lines 4 to 7 onto the Search and Replace sub filter. We can confirm this easily by adding an UPPERCASE filter after the Find and Replace filter.
With this example we can see that multiple filters can be applied within a sub filter. Expanding and Collapsing the Filter TreeJust as you would with Windows Explorer, you can single click the plus sign [+] next to a filter item to expand it out and show its sub filters, and you can single click the minus sign [-] next to a filter item to contract it and hide its sub filters. CommentsComment filters can be used to document sub filters inside them. This is handy because you can hide the details of an operation inside a comment filter, and then collapse the comment filter so that the implementation is hidden. Exercise 5
|
Contact
Us
Support
Community
Tutorials and User Guides (online) |